import request from '@/utils/request'

const api = {
    couponList: '/discount/lists',
    couponAdd: '/discount/add',
    couponEdit: '/discount/edit',
    couponPutaway: '/discount/putaway',
    couponDownfall: '/discount/downfall',
    couponDel: '/discount/delete'
}

export function couponDel (parameter) {
    return request({
        url: api.couponDel,
        method: 'get',
        params: parameter
    })
}

export function couponPutaway (parameter) {
    return request({
        url: api.couponPutaway,
        method: 'post',
        data: parameter
    })
}

export function couponDownfall (parameter) {
    return request({
        url: api.couponDownfall,
        method: 'post',
        data: parameter
    })
}

export function couponEdit (parameter) {
    return request({
        url: api.couponEdit,
        method: 'post',
        data: parameter
    })
}

export function couponAdd (parameter) {
    return request({
        url: api.couponAdd,
        method: 'post',
        data: parameter
    })
}

export function couponList (parameter) {
    return request({
        url: api.couponList,
        method: 'get',
        params: parameter
    })
}
